package tests.suite.tests
{
	import com.gdcnano.nanoamp.media.sound.playlist.IPlaylist;
	import com.gdcnano.nanoamp.media.sound.playlist.M3UPlaylist;
	import com.gdcnano.nanoamp.media.sound.playlist.M3UPlaylistCreator;
	import com.gdcnano.nanoamp.media.sound.playlist.PlaylistCreator;
	
	import flexunit.framework.Assert;
	
	import mx.collections.ArrayCollection;

	public class M3UPlaylistTest
	{
		private static var m3uTracksCollection:String = "Antonio Vivaldi\\The Four Seasons\\01 Allegro.mp3\r\n" +
														"Antonio Vivaldi\\The Four Seasons\\02 Largo e pianisimo sempre.mp3\r\n" +
														"\r\n" + 
														"Antonio Vivaldi\\The Four Seasons\\03 Allegro.mp3\r\n";
																
		
		private static var TRACKS_IN_M3U:int = 3;
		
		private var _playlist:IPlaylist;
		
		private var _playlistCreator:PlaylistCreator;
		
		public function M3UPlaylistTest()
		{
		}
		
		[Test]
		public function canCreateM3UPLaylist():void
		{
			_playlistCreator = new M3UPlaylistCreator();	
			_playlist = _playlistCreator.createPlaylist();
			_playlist.setPlaylistData(m3uTracksCollection);
			Assert.assertEquals(_playlist.tracklist.length, TRACKS_IN_M3U);
		}
	}
}